package com.zx.stock.service.impl;

import com.zx.stock.entity.Stock;
import com.zx.stock.mapper.StockMapper;
import com.zx.stock.service.StockService;
import org.springframework.stereotype.Service;


import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class StockServiceImpl implements StockService {

    @Resource
    private StockMapper stockMapper;

    @Override
    public List<Stock> getStockList(){
        return stockMapper.list(null);
    }

    @Override
    public List<Stock> findByCategory(String category){
        Map<String,Object> params = new HashMap<>();
        params.put("category",category);
        return stockMapper.list(params);
    }
}
